//
//  btn_base.swift
//  weile
//
//  Created by LKM on 16/10/8.
//  Copyright © 2016年 LKM. All rights reserved.
//

import UIKit

class BtnBase: UIButton {

    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */
    
    //代码得重新写。view的生命周期
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        BtnBase.btn_base(self);
    }
    
    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)!
        BtnBase.btn_base(self);
    }
    

    class func btn_base(_ btn:UIButton)  {
        btn.layer.cornerRadius = 8;
        btn.setTitleColor(UIColor.white, for: UIControlState.focused);
        btn.setTitleColor(UIColor.white, for: UIControlState.normal);
        //蓝色
        btn.backgroundColor=R.colors.base_color ;//UIColor(red: 0.07, green: 0.35, blue: 0.61, alpha: 1);
    }
    



}
